//
//  DetaiPageCellFactory_Ht.m
//  WZLProduct
//
//  Created by dllo on 16/3/28.
//  Copyright © 2016年 HaiTeng. All rights reserved.
//

#import "DetaiPageCellFactory_Ht.h"

@implementation DetaiPageCellFactory_Ht

/** 根据model获取我要的哪种cell */
+ (DetaiPageBaseTableViewCell_Ht *)cellForModel:(DetaiPageBaseModel_Ht *)currentModel{
    //获取当前model的类
    NSString *modelClassStr = NSStringFromClass(currentModel.class);
    NSLog(@"当前model为: %@",modelClassStr);
    //将字符串的cell类名,转化为类
    NSString *cellClassStr = [NSString stringWithFormat:@"CellFor%@",modelClassStr];
    //将字符串的类名,转换为类
    Class CellClass = NSClassFromString(cellClassStr);
    //创建cell运行时cell类型为Class的类型
    DetaiPageBaseTableViewCell_Ht *cell = [[CellClass alloc] initWithStyle:(UITableViewCellStyleDefault) reuseIdentifier:modelClassStr];
    return cell;
}


+ (DetaiPageBaseTableViewCell_Ht *)cellForString:(NSString *)currentCellClass{
    Class cellClass = NSClassFromString(currentCellClass);
    DetaiPageBaseTableViewCell_Ht *cell = [[cellClass alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:currentCellClass];
    return cell;
}


@end
